package kr.hkit.androidcomplete02.ch13;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.CompoundButton;
import android.widget.Toast;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.Switch;

public class SwitchEx extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_switchex);
		
		Switch sw = (Switch) findViewById(R.id.ch13_switch);
		sw.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				Toast.makeText(SwitchEx.this, "체크 상태 = " + isChecked, Toast.LENGTH_SHORT).show();
			}
		});
	}
}
